//对外暴露配置路由(常量路由):全部用户都可以访问到的路由
export const constantRoute = [
  {
    //登录
    path: '/login',
    component: () => import('@/views/login/index.vue'),
    name: 'login',
    meta: {
      title: '登录', //菜单标题
      hidden: true, //代表路由标题在菜单中是否隐藏  true:隐藏 false:不隐藏
      icon: 'Promotion', //菜单文字左侧的图标,支持element-plus全部图标
    },
  },
  {
    //登录成功以后展示数据的路由
    path: '/',
    component: () => import('@/layout/index.vue'),
    name: 'layout',
    meta: {
      title: '',
      hidden: false,
      icon: 'Promotion',
    },
    redirect: '/home',
    children: [
      {
        path: '/home',
        component: () => import('@/views/home/index.vue'),
        meta: {
          title: '首页',
          hidden: false,
          icon: 'HomeFilled',
        },
      },
    ],
  },
  {
    path: '/:pathMatch(.*)*',
    component: () => import('@/views/404/index.vue'),
    meta: {
      hidden: true,
    },
  },
  {
    path: '/screen',
    component: () => import('@/views/screen/index.vue'),
    /* 点击会新打开窗口这个name不能变 */
    name: 'Screen',
    meta: {
      hidden: false,
      title: '数据大屏',
      icon: 'Platform',
    },
  },
  {
    path: '/sys',
    component: () => import('@/layout/index.vue'),
    meta: {
      title: '系统信息管理',
      icon: 'Tools',
    },
    redirect: '/sys/user',
    children: [
      {
        path: '/sys/user',
        component: () => import('@/views/sys/user.vue'),
        name: 'User',
        meta: {
          title: '用户管理',
          icon: 'UserFilled',
        },
      },
      {
        path: '/sys/teacher',
        component: () => import('@/views/sys/teacher.vue'),
        name: 'Teacher',
        meta: {
          title: '教师管理',
          icon: 'User',
        },
      },
    ],
  },
  {
    path: '/course',
    component: () => import('@/layout/index.vue'),
    meta: {
      title: '课程信息管理',
      icon: 'Management',
    },
    redirect: '/course',
    children: [
      {
        path: '/course',
        component: () => import('@/views/course/courseList.vue'),
        name: 'Course',
        meta: {
          title: '课程管理',
          icon: 'Connection',
        },
      },
      {
        path: '/course/subject',
        component: () => import('@/views/course/subject.vue'),
        name: 'Category',
        meta: {
          title: '课程分类',
          icon: 'Grid',
        },
      },
      {
        path: '/course/edit/:courseId',
        component: () => import('@/views/course/courseInfo.vue'),
        name: 'CourseEdit',
        meta: {
          title: '修改课程',
          icon: 'Edit',
          hidden: true,
        },
      },
      {
        path: '/course/chapter/:courseId',
        component: () => import('@/views/course/chapterInfo.vue'),
        name: 'ChapterEdit',
        meta: {
          title: '修改章节',
          icon: 'Edit',
          hidden: true,
        },
      },
      {
        path: '/course/publish/:courseId',
        component: () => import('@/views/course/coursePublish.vue'),
        name: 'CoursePublish',
        meta: {
          title: '发布课程',
          icon: 'VideoPlay',
          hidden: true,
        },
      },
      {
        path: '/course/save',
        component: () => import('@/views/course/courseInfo.vue'),
        name: 'CourseSave',
        meta: {
          title: '添加课程',
          icon: 'Edit',
          hidden: true,
        },
      },
    ],
  },
]

//异步路由
/* export const asnycRoute = [] */

//任意路由
export const anyRoute = {
  //任意路由
  path: '/:pathMatch(.*)*',
  redirect: '/404',
  name: 'Any',
  meta: {
    title: '任意路由',
    hidden: true,
    icon: 'DataLine',
  },
}
